package environment.object;

import environment.data.BaseEnvironmentData;
import device.BaseDevice;

import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;


public abstract class BaseEnvironmentObject {

    private Long id;
    private String name;
    private Boolean status = true;
    private List<BaseDevice> listSensors;
    private List<BaseEnvironmentData> listEnvironmentData;

    public BaseEnvironmentObject(Long id,String name){
        this.id = id;
        this.name = name;
        listSensors = new CopyOnWriteArrayList<BaseDevice>();
        listEnvironmentData = new CopyOnWriteArrayList<BaseEnvironmentData>();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public List<BaseDevice> getListSensors() {
        return listSensors;
    }

    public void setListSensors(List<BaseDevice> listSensors) {
        this.listSensors = listSensors;
    }

    public List<BaseEnvironmentData> getListEnvironmentData() {
        return listEnvironmentData;
    }

    public void setListEnvironmentData(List<BaseEnvironmentData> listEnvironmentData) {
        this.listEnvironmentData = listEnvironmentData;
    }

    public void addSensor(BaseDevice sensor){
        listSensors.add(sensor);
    }

    public void addData(BaseEnvironmentData data){
        listEnvironmentData.add(data);
    }
}

